import { useParams, useSearchParams } from "react-router-dom"
const Article = () => {
    //1、useSearchParam方式
    const [params] = useSearchParams()
    const id = params.get("id")
    const name = params.get("name")
    //2、params传参
    const params2 = useParams()
    const id2 = params2.id;
    const name2 = params2.id;
    return (
        <div>
            我是文章页-{id}-{name}<br />
            {id2}-{name2}
        </div>
    )
}

export default Article